#pragma once
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;

typedef struct HFT
{
    int weight;
    int parent, LTree, RTree;
}HFT, * PHFT;
void Select(PHFT HFT, int n, int& s1, int& s2);
void initHFT(PHFT& H, int n);
void showHFT(PHFT& H, int n);